package com.df.ez_game.server.gateway;

import io.netty.channel.Channel;
import lombok.Data;

import java.util.*;

@Data
public class UserSession {
    //元数据
    Map<String,Object> meta = new HashMap<>();
    //连接
    Channel channel;
    //登录后的用户id
    long userId;
    //channel的hashId
    long channelHashId;
    //绑定信息,绑定了哪些逻辑服
    Set<Integer> logicBind = new HashSet<>();

    int state = 1;//1正常 0死亡



    public boolean isActive() {
        return Objects.nonNull(this.channel) && this.channel.isActive();
    }
}
